package net.pimpas.report.processor.projection.impl;

import net.pimpas.report.processor.exception.ProjectionException;
import net.pimpas.report.processor.field.Field;
import net.pimpas.report.processor.projection.AbstractProjection;
import net.pimpas.report.processor.projection.ProjectionType;
import net.pimpas.report.processor.resolver.FieldPropertyResolver;

import org.hibernate.criterion.Projection;
import org.hibernate.criterion.Projections;

public class PropertyProjection extends AbstractProjection {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7871647207976038330L;

	public PropertyProjection(Field field) {
		super(field, ProjectionType.PROPERTY);
	}

	@Override
	public Projection process(String fieldAlias, FieldPropertyResolver resolver) throws ProjectionException {
		return Projections.property(fieldAlias);
	}
}